package com.wise.site.protocol.action;

import com.wise.site.protocol.base.SoapAction;
import com.wise.site.protocol.result.ShopItemsResult;

/**
 * 商家列表action
 * @author huangyue
 *
 */
public class ShopListAction extends SoapAction<ShopItemsResult> {
	private int page = 1;

	public ShopListAction(ACTION_TYPE type, String method) {
		super(type, method);
	}

	@Override
	protected ShopItemsResult parseJson(String response) throws Exception {
		ShopItemsResult sr = new ShopItemsResult();
		sr.parseData(response);
		if(sr.list != null && sr.list.size() > 0){
			page++;
		}
		return sr;
	}
	
	public void moveToNextPage(){
		addJsonParam("page", page);
	}
	
	public void moveToFristPage(){
		page = 1;
		addJsonParam("page", page);
	}
	
	/**
	 *
	 * huangyue  2012-9-27
	 */
	public void setType(int type){
		addJsonParam("type", type);
	}
	
	/**
	 * 设置点击标签的id
	 *
	 * huangyue  2012-9-24
	 */
	public void setTypeId(int id){
		addJsonParam("typeId", id);
	}
	
	public void setKeyword(String keyword){
		addJsonParam("keyword", keyword);
	}

}
